<?php

/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

/**
 * Description of user
 *
 * @author Bui Van Thien
 */
class Model_User extends \Orm\Model
{

    protected static $_properties = array(
        'id',
        'username',
        'password',
        'email',
        'status',
        'created',
        'updated',
        'last_login',
        'status'
    );
    protected static $_observers = array(
        'Orm\Observer_CreatedAt' => array(
            'events' => array('before_insert'),
            'mysql_timestamp' => true,
            'property' => 'created'
        ),
        'Orm\Observer_UpdatedAt' => array(
            'event' => array('before_save'),
            'mysql_timestamp' => true,
            'property' => 'updated'
        )
    );
    protected static $_table_name = 'users';
//    protected static $_has_many = array(
//        'wallet' => array(
//            'key_from' => 'id',
//            'model_to' => 'Model_Wallet',
//            'key_to' => 'user_id',
//            'cascade_save' => false,
//            'cascade_delete' => true
//        ),
//    );
//    protected static $_has_many = array(
//        'category' => array(
//            'key_from' => 'id',
//            'model_to' => 'Model_Category',
//            'key_to' => 'user_id',
//            'cascade_save' => false,
//            'cascade_delete' => true
//        ),
//    );
//    protected static $_has_one = array(
//        'profile' => array(
//            'key_from' => 'id',
//            'model_to' => 'Model_Profile',
//            'key_to' => 'user_id',
//            'cascade_save' => false,
//            'cascade_delete' => true
//        ),
//    );

}
